import axios from 'axios'

const REPAYMENT_BASE_URL = "http://localhost:8090/api/v1/repayment_Schedules";

class RepaymentScheduleService {
    getAllRepaymentSchedules() {
        return axios.get(REPAYMENT_BASE_URL)
    }
    
    createRepaymentSchedule(repaymentSchedule) {
        return axios.post(REPAYMENT_BASE_URL, repaymentSchedule)
    }
    
    getRepaymentScheduleById(id) {
        return axios.get(`${REPAYMENT_BASE_URL}/${id}`)
    }
    
    updateRepaymentSchedule(id, repaymentSchedule) {
        return axios.put(`${REPAYMENT_BASE_URL}/${id}`, repaymentSchedule)
    }
    
    deleteRepaymentSchedule(id) {
        return axios.delete(`${REPAYMENT_BASE_URL}/${id}`)
    }
}

export default new RepaymentScheduleService();